import type { PropType } from 'vue'
import type { ExtrackExpose, ExtractProps } from '@/utils/type'
import type Com from './index.vue'
import { useNamespace } from '@/utils'

export namespace variables {
  export const ns = useNamespace('ChooseImage')
}
export namespace ChooseImageNS {
  export const name = variables.ns.name
  export const props = {
    /**
     * 申请权限提示信息
     * @默认 更新头像
     */
    prompt: String,
    /**
     * 上传数量
     * @默认 1
     */
    uploadCount: {
      type: Number,
      default: 1
    },
    /**
     * 上传成功回调函数
     */
    uploadSuccess: Function as PropType<(paths: string[]) => any>
  }
  type BaseProps = ExtractProps.Types<typeof props>
  export type Props = BaseProps
  export const Component = <{
    new(): {
      $props: Props
    }
  }>{}
  export type Instance = ExtrackExpose.Types<typeof Com>
}